<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/
?>
<HTML>
<HEAD>
    <TITLE>区域管理</TITLE>
    <META content="MSHTML 6.00.2800.1276" name=GENERATOR>
    <META http-equiv=Content-Type content="text/html; charset=utf-8">
    <META http-equiv=Content-Style-Type content=text/css>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <script language="javascript" src="js/stm31.js"></script>
<script language="javascript" src="js/1201.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script language="javascript" type="text/javascript" src="DatePicker/WdatePicker.js"></script>
<LINK href="css/mainWincn.css" type=text/css  media=screen rel=stylesheet>
<LINK href="css/1201.css" type=text/css  media=screen rel=stylesheet>
<LINK href="css/mainWin.css" type=text/css  media=screen rel=stylesheet>

	
    <base target="_self">
</HEAD>
<body marginwidth="0" topmargin="0" leftmargin="0" onLoad="onLoad()" marginheight="0">
<form name="savefrom1" method="post" action="admin.php?ac=index&fileurl=city">
<input type="hidden" id="do" name="do" />
  <CENTER>
			<DIV ID=Title_bar>
				<DIV ID=Title_bar_Head>
					<DIV ID=Title_Head>
					</DIV>
					<DIV ID=Title>
						<img border="0" width="13" height="13" src="images/title_arrow.gif" />
						区域管理
					</DIV>
					<DIV ID=Title_End>
					</DIV>
				</DIV>
				<DIV ID=Title_bar_bg_up>
					<DIV ID=Title_bar_bg>
					</DIV>
				</DIV>
				<DIV ID=Title_bar_Tail>
					<DIV ID=Title_FuncBar>
						
							<ul>
								<LI CLASS=line></LI>
								
									<!--<LI CLASS=title>

    <div class="Btn">
      <a name="BTN830007115982UX8" href="admin.php?ac=index&do=delete&fileurl=city">删除</a>  
    </div>

</LI>
									<LI CLASS=line></LI>
								
									<LI CLASS=title><a name="BTN83000711598O1E2" href="admin.php?ac=index_edit&fileurl=city"></a>

    <div class="Btn">
        <a href="javascript:savefrom1.submit();">修改</a>
    </div>

</LI>
									<LI CLASS=line></LI> -->
								
									<LI CLASS=title>

    <div class="Btn">
       <a name="BTN830007115981A4C" href="admin.php?ac=add&fileurl=city">新建区域</a> 
    </div>

</LI>
									<LI CLASS=line></LI>
								
							</ul>
						
					</DIV>
				</DIV>
			</DIV>
			
			<TABLE cellSpacing=0 cellPadding=0 border=0 width=98%>
			<tr><td>
			<?php
			
			global $db;
	        $query = $db->query("SELECT * FROM ".DB_TABLEPRE."city where father='0' ORDER BY id Asc  ");
			while ($row = $db->fetch_array($query)) {
			$rsfnow = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."city where father='".$row[id]."' ORDER BY id desc limit 0,1");
			?>
			<TABLE cellSpacing=0 cellPadding=0 border=0 width=100%>
          <TR HEIGHT=22 onclick=D<?=$row['id']?>.click() id=D<?=$row['id']?>TR class=TableDetail2>
         <TD class=MemoTD width=32><IMG class=outline id=D<?=$row['id']?> src="images/down.gif"></TD>
          <TD class=MemoTD><?=$row['name']?></TD>
		  <TD width="100" align="right" class=MemoTD><a href="admin.php?ac=edit&do=edit&fileurl=city&id=<?=$row['id']?>">修改</a>
		  <?php
			
	       if($rsfnow[id]==''){
		   ?>
		   | <a href="admin.php?ac=index&fileurl=city&do=delete&id=<?=$row['id']?>">删除</a>
		   <?php
		   }
		   ?>
		   </TD>
            </TR>
            </TABLE>
			<?php
			
	       if($rsfnow[id]!=''){
	      get_ArticleSorts_list($row['id'],0,0);
	       }
			
			}
			?>
			</td></tr></table>
  </CENTER>
</form>
</body>
</HTML>